package com.powernode.work.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.powernode.commons.utils.ResponseData;
import com.powernode.work.bean.CustomerBean;
import com.powernode.work.dao.CustomerMapper;
import com.powernode.work.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CustomerServiceImpl implements CustomerService {
    @Autowired
    private CustomerMapper dao;
    /**
     * 分页显示所有的客户
     * @param pageNumber
     * @param pageSize
     * @return
     */
    @Override
    public ResponseData page(Integer pageNumber, Integer pageSize) {
        Page<CustomerBean> page = PageHelper.startPage(pageNumber, pageSize);
        dao.selectAll();
        return ResponseData.ok(page.getResult(),page.getTotal());
    }
}
